function myCls() {
    this.name = "测试"
}

myCls.prototype.say = function () {
    return this.name
}

let my = new myCls()
console.log(my.say())

class myCls2 {
    constructor(name) {
        _name = name
    }
    say() {
        return myCls2._name
    }
}

let my2=new myCls2('测试2')
console.log(my2.say())